from faker import Faker
from flask import current_app
import datetime


fake = Faker("zh_CN")


def get_name():
    name = fake.name()
    current_app.logger.info(f"faker 生成姓名: {name}")
    return name


def get_phone_number():
    phone_number = fake.phone_number()
    current_app.logger.info(f"faker 生成手机号: {phone_number}")
    return phone_number


def get_id_card():
    id_card = fake.ssn()
    current_app.logger.info(f"faker 生成身份证号: {id_card}")
    return id_card


def get_now():
    now = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d %H:%M:%S')
    current_app.logger.info(f"返回当前时间: {now}")
    return now
